scrollbarDrag
Type
message
Summary
Sent to a field, scrollbar, or group when the user drags the scrollbar thumb or when a text selection causes a field to scroll.
Syntax
scrollbarDrag <pNewPosition>
Description
Handle the scrollbarDrag message if you want to respond to the user dragging the scrollbar thumb: for example, to update a counter on the card.
If the user clicks one of the arrows or the gray region of the scrollbar, and the appropriate message is not handled anywhere in the message path, a scrollbarDrag message is sent. In other words, you can use a scrollbarDrag handler to handle all scrollbar movements.
If the select command is used to select text within a scrolling field, and this causes the field to scroll to bring the selected text into view, a scrollbarDrag message is sent to the field.
Parameters
Name | Type | Description |
---|---|---|
pNewPosition | The new position of the scrollbar thumb. This parameter is passed only if the object is a scrollbar. |
Examples
on scrollbarDrag newValue -- display current line number
put newValue div the textHeight of me + 1 into field "Line Number"
end scrollbarDrag
Related
glossary: scrollbar thumb, handle, handler, message, card, field, command
keyword: field, scrollbar, selection
message: scrollbarBeginning
property: selected
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile